package com.crazy.boot.util;

public class ResultUtils {
    private String code;
    private String msg;
    private Integer count;
    private Object data;


    /**
     * 返回,带数据
     * @param code 状态码
     * @param msg 提示信息
     * @return
     */
    public static ResultUtils toClient(String code, String msg, Integer count, Object data){
        return new ResultUtils(code,msg,count,data);
    }

    /**
     * 返回,不带数据
     * @param code 状态码
     * @param msg 提示信息
     * @return
     */
    public static ResultUtils toClient(String code, String msg){
        return new ResultUtils(code,msg,null,null);
    }

    private ResultUtils(String code, String msg, Integer count, Object data) {
        this.code = code;
        this.msg = msg;
        this.count = count;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
